Programming Problem 1: Substitution Cipher
Objective
Implement a Python program to perform Substitution Cipher encryption.
Hints
-
Create a function
substitution_cipher_encrypt(plaintext, key)
with parameters for the
plaintext and a
substitution key.
-
The substitution key should be a
dictionary mapping each letter to
its replacement.
-
Handle both uppercase and lowercase
letters while preserving spaces and non-alphabetic characters.
-
Iterate through each letter in the
plaintext and replace it according to the substitution key.
Terminal
Programming Problem 2: Caesar Cipher Encryption
Background
You are given a plaintext message containing only uppercase English
letters. Your task is to encrypt the message using a
Caesar Cipher. The Caesar Cipher is a
substitution cipher where each letter in the plaintext is shifted a
certain number of places down or up the alphabet.
Objective
Write a Python function called
caesar_cipher_encrypt that takes two
parameters: the plaintext message and the shift value. The function
should return the encrypted message.
Hints
-
Ensure that the function handles only
uppercase letters. Ignore spaces and
other characters.
-
Use the ASCII values of characters
to perform the shift.
-
Use the modulo operator to handle
wrapping around the alphabet.
Terminal
Feel free to test this solution with different plaintext and shift
values.